/*
 * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
 *
 * SPDX-License-Identifier: GPL-2.0-only
 */
typedef
signed
char
int8_t
;
typedef
short
int16_t
;
typedef
int
int32_t
;
typedef
long
long
int64_t
;
typedef
unsigned
char
uint8_t
;
typedef
unsigned
short
uint16_t
;
typedef
unsigned
int
uint32_t
;
typedef
unsigned
long
long
uint64_t
;
typedef
int8_t
int_fast8_t
;
typedef
int
int_fast16_t
;
typedef
int
int_fast32_t
;
typedef
int64_t
int_fast64_t
;
typedef
unsigned
char
uint_fast8_t
;
typedef
unsigned
int
uint_fast16_t
;
typedef
unsigned
int
uint_fast32_t
;
typedef
uint64_t
uint_fast64_t
;
typedef
long
intptr_t
;
typedef
unsigned
long
uintptr_t
;
typedef
int8_t
int_least8_t
;
typedef
int16_t
int_least16_t
;
typedef
int32_t
int_least32_t
;
typedef
int64_t
int_least64_t
;
typedef
uint8_t
uint_least8_t
;
typedef
uint16_t
uint_least16_t
;
typedef
uint32_t
uint_least32_t
;
typedef
uint64_t
uint_least64_t
;
typedef
long
long
intmax_t
;
typedef
unsigned
long
long
uintmax_t
;
typedef
unsigned
size_t
;
typedef
int
ssize_t
;
typedef
unsigned
short
__uint16_t
;
typedef
unsigned
int
__uint32_t
;
typedef
unsigned
long
long
__uint64_t
;
typedef
long
time_t
;
typedef
int
suseconds_t
;
typedef
int
pid_t
;
typedef
int
id_t
;
typedef
int
uid_t
;
typedef
int
gid_t
;
typedef
int
key_t
;
typedef
struct
__pthread
*
pthread_t
;
typedef
int
pthread_once_t
;
typedef
int
pthread_key_t
;
typedef
int
pthread_spinlock_t
;
typedef
struct
{
struct
{
int
__i
[
9
]
;
size_t
__s
[
9
]
;
}
__u
;
}
pthread_attr_t
;
typedef
unsigned
pthread_mutexattr_t
;
typedef
unsigned
pthread_condattr_t
;
typedef
unsigned
pthread_barrierattr_t
;
typedef
struct
{
unsigned
__attr
[
2
]
;
}
pthread_rwlockattr_t
;
typedef
struct
{
struct
{
int
__i
[
6
]
;
void
*
__p
[
6
]
;
}
__u
;
}
pthread_mutex_t
;
typedef
struct
{
struct
{
int
__i
[
12
]
;
void
*
__p
[
12
]
;
}
__u
;
}
pthread_cond_t
;
typedef
struct
{
struct
{
int
__i
[
8
]
;
void
*
__p
[
8
]
;
}
__u
;
}
pthread_rwlock_t
;
typedef
struct
{
struct
{
int
__i
[
5
]
;
void
*
__p
[
5
]
;
}
__u
;
}
pthread_barrier_t
;
typedef
long
long
off_t
;
typedef
unsigned
int
mode_t
;
typedef
unsigned
int
nlink_t
;
typedef
unsigned
long
long
ino_t
;
typedef
long
long
dev_t
;
typedef
long
blksize_t
;
typedef
long
long
blkcnt_t
;
typedef
unsigned
long
long
fsblkcnt_t
;
typedef
unsigned
long
long
fsfilcnt_t
;
typedef
void
*
timer_t
;
typedef
int
clockid_t
;
typedef
unsigned
long
clock_t
;
typedef
unsigned
char
u_int8_t
;
typedef
__uint16_t
u_int16_t
;
typedef
__uint32_t
u_int32_t
;
typedef
__uint64_t
u_int64_t
;
typedef
char
Buf
[
(
(
1ul
<<
(
12
)
)
)
]
;
typedef
struct
dataport_ptr_
{
uint32_t
id
;
off_t
offset
;
}
dataport_ptr_t
;
typedef
unsigned
wchar_t
;
typedef
struct
{
int
quot
,
rem
;
}
div_t
;
typedef
struct
{
long
quot
,
rem
;
}
ldiv_t
;
typedef
struct
{
long
long
quot
,
rem
;
}
lldiv_t
;
extern
char
DataIn_data
[
(
(
sizeof
(
Buf
)
)
+
(
(
sizeof
(
Buf
)
)
%
(
(
(
1ul
<<
(
12
)
)
)
)
==
0
?
0
:
(
(
(
(
1ul
<<
(
12
)
)
)
)
-
(
(
sizeof
(
Buf
)
)
%
(
(
(
1ul
<<
(
12
)
)
)
)
)
)
)
)
]
;
extern
volatile
Buf
*
DataIn
;
int
DataIn__run
(
void
)
{
/* Nothing required. */
return
0
;
}
int
DataIn_wrap_ptr
(
dataport_ptr_t
*
p
,
void
*
ptr
)
{
if
(
(
uintptr_t
)
ptr
<
(
uintptr_t
)
DataIn_data
||
(
uintptr_t
)
ptr
>=
(
uintptr_t
)
DataIn_data
+
sizeof
(
Buf
)
)
{
return
-
1
;
}
p
->
id
=
0
;
p
->
offset
=
(
off_t
)
(
(
uintptr_t
)
ptr
-
(
uintptr_t
)
DataIn_data
)
;
return
0
;
}
void
*
DataIn_unwrap_ptr
(
dataport_ptr_t
*
p
)
{
if
(
p
->
id
==
0
)
{
return
(
void
*
)
(
(
uintptr_t
)
DataIn_data
+
(
uintptr_t
)
p
->
offset
)
;
}
else
{
return
(
(
void
*
)
0
)
;
}
}
